package com.rzcode.coinex.kernel.dao.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Builder;
import lombok.Data;
import lombok.NoArgsConstructor;

import java.math.BigDecimal;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * 挖矿订单实体类，用于记录用户购买矿机的详细信息及挖矿状态。
 */
@Data
@Builder
@AllArgsConstructor
@NoArgsConstructor
@TableName(value = "mining_order")
public class MiningOrder {

    /**
     * 订单ID，主键，自动生成的唯一标识。
     */
    @ApiModelProperty(value = "订单ID", example = "1")
    private Long id;

    /**
     * 矿机类型（0：一般矿机，1：邀请燃料矿机）
     */
    @ApiModelProperty(value = "矿机类型", allowableValues = "0,1", example = "0")
    private int type = 0;

    /**
     * 矿机图片
     */
    @ApiModelProperty(value = "矿机图片", example = "https://example.com/image.png")
    private String image;

    /**
     * 矿机名称
     */
    @ApiModelProperty(value = "矿机名称", example = "黄金矿机")
    private String title;

    /**
     * 领取人ID
     */
    @ApiModelProperty(value = "领取人ID", required = true, example = "1001")
    private Long memberId;

    /**
     * 活动ID
     */
    @ApiModelProperty(value = "活动ID", example = "1")
    private Long activityId;

    /**
     * 挖矿产出周期（0：日，1：周，2：月，3：年）
     */
    @ApiModelProperty(value = "挖矿产出周期", allowableValues = "0,1,2,3", example = "0")
    private int period = 0;

    /**
     * 挖矿状态（0：待启动，1：挖矿中，2：已结束）
     */
    @ApiModelProperty(value = "挖矿状态", allowableValues = "0,1,2", example = "0")
    private int miningStatus = 0;

    /**
     * 持续天数
     */
    @ApiModelProperty(value = "持续天数", example = "30")
    private int miningDays;

    /**
     * 已挖矿天数
     */
    @ApiModelProperty(value = "已挖矿天数", example = "10")
    private int miningedDays;

    /**
     * 矿机产出币种
     */
    @ApiModelProperty(value = "矿机产出币种", example = "BTC")
    private String miningUnit;

    /**
     * 原始日产出
     */
    @ApiModelProperty(value = "原始日产出", example = "1.23456789")
    private BigDecimal miningDaysprofit = BigDecimal.ZERO;

    /**
     * 当前日产出（因邀请好友购买矿机会增加产出）
     */
    @ApiModelProperty(value = "当前日产出", example = "1.35678901")
    private BigDecimal currentDaysprofit = BigDecimal.ZERO;

    /**
     * 挖矿总产出
     */
    @ApiModelProperty(value = "挖矿总产出", example = "34.56789012")
    private BigDecimal totalProfit = BigDecimal.ZERO;

    /**
     * 邀请好友（且购买矿机）产能增加百分比（为0则不增加）
     */
    @ApiModelProperty(value = "产能增加百分比", example = "0.1")
    private BigDecimal miningInvite = BigDecimal.ZERO;

    /**
     * 产能增加上限百分比（为0则无上限）
     */
    @ApiModelProperty(value = "产能增加上限百分比", example = "0.5")
    private BigDecimal miningInvitelimit = BigDecimal.ZERO;

    /**
     * 结束日期
     */
    @ApiModelProperty(value = "结束日期", example = "2023-01-01 12:00:00")
    private LocalDateTime endTime;

    /**
     * 创建时间
     */
    @ApiModelProperty(value = "创建时间", example = "2023-01-01 12:00:00")
    private LocalDateTime createTime;
}
